package com.hfy.admin.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hfy.model.dto.admin.ApplyMusicianDto;
import com.hfy.model.po.admin.ApplyMusicianPo;
import org.apache.ibatis.annotations.*;

/**
 * @ author 韩
 * time: 2024/12/24 13:11
 */

@Mapper
public interface ApplyMusicianMapper extends BaseMapper<ApplyMusicianPo> {
    @Insert("INSERT INTO `apply_musician` (`account`,`musician_name`,`musician_avatar`,`type`,`area`,`brief`) VALUES " +
            "(#{account}, #{name}, #{avatar}, #{type}, #{area}, #{brief})")
    void insertApplyMusicianRecord(ApplyMusicianDto dto);

    @Select("SELECT status FROM `apply_musician` WHERE account = #{account} && die = 0")
    int queryApplyStatus(@Param("account") Long account);

    @Update("UPDATE `apply_musician` SET die=1 WHERE account = #{account}")
    void deleteByLogic(@Param("account") Long account);

}
